<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNewsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //资讯
        Schema::create('news', function (Blueprint $table) {
            $table->increments('id');
            $table ->string('title')->nullable()->comment('资讯名称');
            $table ->integer('img_id')->default(0)->comment('封面图id');
            $table ->string('desc')->nullable()->comment('资讯描述');
            $table ->string('type')->nullable()->comment('类型');
            $table->integer('industry_id')->default(0)->comment('行业id');
            $table->integer('classify_id')->default(0)->comment('资讯分类');
            $table->string('province')->nullable()->comment('省');
            $table->string('city')->nullable()->comment('市');
            $table->string('from')->default('local')->comment('来源');
            $table->string('media_id')->nullable()->comment('微信素材media_id');
            $table->text('info')->nullable()->comment('资讯详情');
            $table->string('link_url')->nullable()->comment('资讯详情链接');
            $table->integer('video_id')->default(0)->comment('视频');
            $table->integer('advert_img_id')->default(0)->comment('广告图');
            $table->integer('browse_num')->default(0)->comment('浏览量');
            $table->integer('attention_num')->default(0)->comment('关注数量');
            $table ->integer('sort')->default(0)->comment('排序');
            $table->integer('status')->default(0)->comment('状态');
            $table -> softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
